{extend name="admin/base_pop" /}
{block name="resources"}
<link rel="stylesheet" type="text/css" href="ADMIN_CSS/member_detail.css" />
{/block}
{block name="main"}
<div class="set-style">
	<h4><span></span>基本信息</h4>
	<dl>
		<dt>会员头像：</dt>
		<dd>
			<div class="member-img">
				{if condition="$member_detail['user_info']['user_headimg']"}
					<img src="{:__IMG($member_detail['user_info']['user_headimg'])}">
				{else /}
					<img src="{:__IMG($default_headimg)}">
				{/if}

			</div>
		</dd>
	</dl>
	<dl>
		<dt>UID：</dt>
		<dd>
			{$member_detail['uid']}
		</dd>
	</dl>
	<dl>
		<dt>用户名：</dt>
		<dd>
			{if condition="$member_detail['member_name']"}{$member_detail['member_name']}{else /}--{/if}
		</dd>
	</dl>
	<dl>
		<dt>等级：</dt>
		<dd>
			{if condition="$member_detail['level_name']"}{$member_detail['level_name']}{else /}--{/if}
		</dd>
	</dl>
	<dl>
		<dt>{:lang("team_sales")}：</dt>
		<dd>
			{$member_detail['team_sales']}
		</dd>
	</dl>
<!--	<dl>-->
<!--		<dt>{:lang('member_rank_point')}：</dt>-->
<!--		<dd>-->
<!--			{$member_detail['rank_point']}-->
<!--		</dd>-->
<!--	</dl>-->
	<dl>
		<dt>{:lang("member_integral")}：</dt>
		<dd>
			{$member_detail['point']} <a onclick="account_update({$member_detail['uid']})" style="display: none">修改</a>
		</dd>
	</dl>
	<dl>
		<dt>{:lang("member_balance")}：</dt>
		<dd>
			{$member_detail['balance']}
		</dd>
	</dl>
<!--	<dl>-->
<!--		<dt>{:lang("member_salary")}：</dt>-->
<!--		<dd>-->
<!--			{$member_detail['salary']}-->
<!--		</dd>-->
<!--	</dl>-->
<!--	<dl>-->
<!--		<dt>大区业绩：</dt>-->
<!--		<dd>-->
<!--			{$member_detail['big_team_sales']}-->
<!--		</dd>-->
<!--	</dl>-->
<!--	<dl>-->
<!--		<dt>小区业绩：</dt>-->
<!--		<dd>-->
<!--			{$member_detail['small_team_sales']}-->
<!--		</dd>-->
<!--	</dl>-->


	<dl>
		<dt>标签：</dt>
		<dd>
			{if condition="$member_detail['label_name']"}{$member_detail['label_name']}{else /}--{/if}
		</dd>
	</dl>
	<dl>
		<dt>最后登录：</dt>
		<dd>
			{if condition="$member_detail['user_info']['current_login_time']"}{:date('Y-m-d H:i:s',$member_detail['user_info']['current_login_time'])}{else /}--{/if}
		</dd>
	</dl>

	<h4><span></span>个人信息</h4>
	<dl>
		<dt>昵称：</dt>
		<dd>
			{if condition="$member_detail['user_info']['nick_name']"}
			{$member_detail['user_info']['nick_name']}
			{else /}--{/if}
		</dd>
	</dl>
	<dl>
		<dt>标签：</dt>
		<dd>
			{if condition="$member_detail['label_name']"}{$member_detail['label_name']}{else /}--{/if}
		</dd>
	</dl>
	<dl>
		<dt>手机号：</dt>
		<dd>
			{if condition="$member_detail['user_info']['user_tel']"}
			{$member_detail['user_info']['user_tel']}
			{else /}--{/if}
		</dd>
	</dl>
	<dl>
		<dt>性别：</dt>
		<dd>
			{if condition="$member_detail['user_info']['sex'] eq 1"}
				<span>男</span>
			{elseif condition="$member_detail['user_info']['sex'] eq 2"}
				<span>女</span>
			{else /}
				<span>保密</span>
			{/if}
		</dd>
	</dl>
	<dl>
		<dt>邮箱：</dt>
		<dd>
			{if condition="$member_detail['user_info']['user_email']"}
			<span>{$member_detail['user_info']['user_email']}</span>
			{else /}
			<span>--</span>
			{/if}
		</dd>
	</dl>
	<dl>
		<dt>QQ：</dt>
		<dd>
			{if condition="$member_detail['user_info']['user_qq']"}
			<span>{$member_detail['user_info']['user_qq']}</span>
			{else /}
			<span>--</span>
			{/if}
		</dd>
	</dl>
	<h4><span></span>交易信息</h4>
	<!-- 交易信息 -->
	<div class="member-order">
			<div>
				<div class="member-fileds-info">
					<span>累计消费：</span>
					<span>￥{$member_detail['member_cunsum']}</span>
				</div>
				<div class="member-fileds-info">
					<span>消费次数：</span>
					<span>{$member_detail['order_count']}</span>
				</div>
				<div class="member-fileds-info">
					<span>平均消费金额：</span>
					<span>￥{$member_detail['avg_order_money']}</span>
				</div>
				<div class="member-fileds-info">
					<span>最近消费时间：</span>
					{if condition="$member_detail['last_pay_time']"}
					<span>{:date('Y-m-d H:i:s',$member_detail['last_pay_time'])}</span>
					{else /}
					<span>--</span>
					{/if}
				</div>
			</div>
	</div>
</div>


<!-- 账户调整 -->
<div class="modal fade hide" id="account_update" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
	<div class="modal-dialog">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
				<h3>账户调整</h3>
			</div>
			<div class="account-point">
				<div class="modal-body">
					<div class="modal-infp-style">
						<table>
							<tr>
								<td>
									{:lang("member_integral")}：
									<input type="number" id="point" value="{$member_detail['point']}" class="input-common harf">
								</td>

							</tr>
						</table>

					</div>
				</div>
				<div class="modal-footer">
					<input type="hidden" id="uid" />
					<button class="btn-common btn-big" onclick="addAccount()">保存</button>
					<button class="btn-common-cancle btn-big" data-dismiss="modal">关闭</button>
				</div>
			</div>
		</div>
	</div>
</div>
{/block}
{block name="script"}
<script type="text/javascript">
	function account_update(uid){
		$("#uid").val(uid);
		$("#account_update").modal("show");
	}


	//充值
	function addAccount(){
		//alert(type)
		var uid = $("#uid").val();
		var point = $("#point").val();

		if(uid == ''){
			showTip('参数错误','warning');
			return false;
		}
		if(point == ''){
			showTip('金额不能为空','warning');
			return false;
		}

		$.ajax({
			type : "post",
			url : "{:__URL('ADMIN_MAIN/member/updatememberaccount')}",
			data : {
				"uid" : uid,
				"balance" : point
			},
			success : function(data) {
				if (data["code"] > 0) {
					showTip(data['message'],'success');
					location.reload();
					$("#account_update").modal("hide");
				}else{
					showTip(data['message'],'error');
				}
			}
		});
	}

</script>
{/block}
